<?php
namespace app\common\model;
use think\Model;
use think\Db;
class Order {
	public function add_syorder($sn,$agent_id,$pay_type,$p_score,$zs_score,
	$price,$pay_price,$user_id,$emp_id,$status,$type,$house_id=0){

			$data['sn']=$sn;
			$data['agent_id']=$agent_id;
			$data['user_id']=$user_id;
			$data['emp_id']=$emp_id;
			$data['total_price']=$price;
			$data['pay_type']=$pay_type;
			$data['pay_price']=$pay_price;
			$data['add_time']=now_time();
			$data['need_score']=$p_score;
			$data['give_score']=$zs_score;
			$data['status']=$status;
			$data['type']=$type;
			$data['house_id']=$house_id;
			$res=db('agent_syorder')->insertGetId($data);
			return $res;
				
	}
	public function add_order_items($agent_id,$order_id,$price,$num,$goods_id,$name,$unit,$dk_price,$zs_price){
		$data['agent_id']=$agent_id;
		$data['order_id']=$order_id;
		$data['price']=$price;
		$data['num']=$num;
		$data['goods_id']=$goods_id;
		$data['name']=$name;
		$data['unit']=$unit;
		$data['zs_price']=$zs_price;
		$data['dk_price']=$dk_price;
		$res=db('agent_syorder_items')->insertGetId($data);
		return $res;
	}
}
?>